package com.chao.springcloud.config;

import com.netflix.loadbalancer.AvailabilityFilteringRule;
import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

import java.util.Random;

@Configuration
public class ConfigBean {

    @LoadBalanced   // 配置负载均衡实现,Ribbon
    @Bean
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }

}
